#include <stdio.h>

/* Prints a horizontal histogram of the lengths of words */

#define MAX_WORDS 100
#define IN 1
#define OUT 0

int main() {
  int c, length, nth_word, i, j, state, lengths[MAX_WORDS];

  nth_word = length = 0;
  state = OUT;
  for (i = 0; i < MAX_WORDS; ++i) {
    lengths[i] = 0;
  }

  while ((c = getchar()) != EOF && nth_word < MAX_WORDS) {
    if (c == ' ' || c == '\t' || c == '\n') {
      state = OUT;
    }

    if (nth_word == 0) {
      state = IN;
      ++nth_word;
      ++length;
    }

    if (state == IN) {
      ++length;
    }

    if (state == OUT) {
      lengths[nth_word] = length;
      ++nth_word;
      length = 1;
      state = IN;
    }
  }

  lengths[nth_word] = length;

  for (i = 1; i <= nth_word; ++i) {
    printf("%3d: ", i);
    for (j = 0; j < lengths[i]; j++) {
      putchar('-');
    }
    putchar('\n');
  }
}
